package ch.exploadingelephants.model;

/**
 * @author Sandro De Zanet
 * 
 */
public class Point2D {

    /**
     * @param x
     * @param y
     */
    public Point2D(int x, int y) {
	this.x = x;
	this.y = y;
    }

    public int x;
    public int y;

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object o) {
	if (o != null) {
	    if (o instanceof Point2D) {
		Point2D other = (Point2D) o;
		return other.x == this.x && other.y == this.y;
	    }
	}
	return false;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
	return x + y;
    }

}
